<%@ page contentType="text/html;charset=gbk" session="false"%>
<%@ include file="/common/common.jsp"%>
<%@ include file="/common/isLogin.jsp"%>
<%@ page import="org.json.JSONObject"%>
<%
out.clear();
ProvinceService provinceServer = env.getBean(ProvinceService.class);
String id = T.stringValue(request.getParameter("id"),"0");
String areaType = T.stringValue(request.getParameter("areaType"),"city");
if("/area".equals(request.getPathInfo())) {
    List<Province> list = provinceServer.getListByParentId(id);
	List<Map<String,String>> datas = new ArrayList<Map<String,String>>();
	for(Province province: list){
		Map<String,String> tmpMap = new LinkedHashMap<String,String>();
		tmpMap.put("value",province.getCodeId());
		tmpMap.put("name",province.getName());
		datas.add(tmpMap);
	}
	Map<String,List<Map<String,String>>> map = new LinkedHashMap<String,List<Map<String,String>>>();
	map.put(areaType, datas);
	out.println("("+new JSONObject(map).toString()+")");
	return;
}
%>